<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="utf-8">
    <meta content="width=device-width, initial-scale=1" name="viewport">
    <title>玉灵 QQ:7031633 Email:webrx@126.com</title>
    <meta content="关键字" name="keywords">
    <meta content="简介" name="description">
</head>

<body>
<p>按f2打开百度</p>

<script>
    window.onkeyup = function (event) {
        console.log(event.keyCode)
        console.log(event.key)
        if (event.key === 'F2') {
            location.href = 'http://www.baidu.com'
        }
    }
</script>
</body>
</html>
